package org.jeecg.modules.cascv.image.job;

import org.jeecg.modules.cascv.image.service.merge.ImageService;
import org.jeecg.modules.cascv.image.service.video.VideoService;
import org.jeecg.modules.cascv.image.util.LaptopConstant;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.Map;

@Service
public class InitJob {

    @Resource
    private ApplicationContext applicationContext;

    @PostConstruct
    public void init(){
        Map<String, ImageService> imageServiceMap = applicationContext.getBeansOfType(ImageService.class);
        for (Map.Entry<String, ImageService> entry : imageServiceMap.entrySet()) {
            String s = entry.getValue().idsNames();
            String[] arr = s.split(",");
            for (String s1 : arr) {
                LaptopConstant.imageServiceMap.put(s1, entry.getValue());
            }

        }
    }

}
